﻿using System;
using System.Collections.Generic;

using System.Text;
using Module.Common.Models;
using Module.Core.DAO.DAO;
using Module.Core.EntitiesInfo.TablesInfo;

namespace Module.Core.BusinessLogic.NewLetterEmails
{
   public class NewLetterEmailsBL
    {
       public static int Insert(NewsLetterEmails newLetterEmailsInfo)
       {
           try
           {
               return new NewLetterEmailsDAO().Insert(newLetterEmailsInfo);
           }
           catch (Exception ex)
           {
               throw;
           }
       }

       /// <summary>
       /// Saves a record to the NewsLetterEmails table.
       /// </summary>
       public static void Update(NewsLetterEmails newLetterEmailsInfo)
       {
           try
           {
               new NewLetterEmailsDAO().Update(newLetterEmailsInfo);
           }
           catch (Exception ex)
           {
               throw;
           }

       }


       /// <summary>
       /// Delete a record from the NewsLetterEmails table.
       /// </summary>
       public static void Delete(int EmailId)
       {
           try
           {
               new NewLetterEmailsDAO().Delete(EmailId);
           }
           catch (Exception ex)
           {
               throw;
           }

       }

       /// <summary>
       /// Selects a  record from the NewsLetterEmails table.
       /// </summary>
       public static NewsLetterEmails Select(int EmailId)
       {
           try
           {
               return new NewLetterEmailsDAO().Select(EmailId);
           }
           catch (Exception ex)
           {
               throw;
           }

       }


       public static CHRTList<NewsLetterEmails> SearchAll(string FullName, int status, int from, int to)
       {
           try
           {
               return new NewLetterEmailsDAO().SearchAll(FullName, status, from, to);
           }
           catch (Exception ex)
           {
               throw;
           }

       }
       public static int GetCount(string FullName, int status)
       {
           try
           {
               return new NewLetterEmailsDAO().GetCount(FullName, status);
           }
           catch (Exception)
           {

               throw;
           }
       }
	
    }
}
